#ifndef ENEMY_H
#define ENEMY_H

#include <nds.h>
#include "fixed.h"
#include "ellen/ln.h"
#include "reference.h"
#include "weapon.h"
#include "game.h"

//Sprite Images
#include "enemy1.h"
#include "enemy2.h"
#include "enemy3.h"
#include "Boss.h"

class enemy{
public:
	enemy();
	~enemy();

	void createEnemy(const void * sprData,const void * sprPalette);
	void destoryEnemySprite();
	//updates animation
	//pass into function start and end frame of animation 
	void updateEnemy(int start,int end);
	void display();
	void move(int direction);
	void applyGravity();
	void applyDamage(int damage);
	void setPosition(tFloat posX,tFloat posY);
	void handleAnimation(int start,int end);
	void setOffset(tFloat posX,tFloat posY);
	void setHealth(int health);
	void setHidden(bool hidden);
	void printInfo();

	bool checkCollide(BoundingBox target);
	bool checkCollideXprev(BoundingBox target);
	bool checkCollideYprev(BoundingBox target);
	bool isDead();

	void stopVertical();
	void stopHorizontal();

	void setAI(int AI);
	int getAI();
	void enemyproximity(tFloat posX,tFloat posY);
	void enemyAI(tFloat posX,tFloat posY);

	bool getFacingRight();

	BoundingBox getBounds();

	t2DVector getPos();
	t2DVector getPosPrev();
	lnSprite* e_sprite;

private:
	
	lnSpriteAnim* e_spriteAnim;

	tFloat e_maxSpeedX;
	tFloat e_maxSpeedXOrgin;
	tFloat e_maxSpeedY;
	tFloat e_walkingSpeed;
	tFloat e_gravityConstant;

	int e_health;
	int e_AI;
	bool e_facingRight;
	bool e_dead;
	bool e_inAir;
	bool e_onPatrol;
	int enemyChargeCounter;
	bool chargeRecently;
	int shotTimer;
	bool didShoot;
	

	t2DVector e_patrolPos;
	t2DVector e_position;
	t2DVector e_positionPrev;
	t2DVector e_localPosition;
	t2DVector e_enemyOffset;
	t2DVector e_velocity;

	BoundingBox e_boundingBox;
	BoundingBox e_prevBoundingBox;
};

#endif